UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OAm6HeZKoA84fAOqbm+cw7ty+YhkJ8reMnFQiNv4W/c='
WHERE
key_id = '0c85a2210a48cd550af20e8e0eee3595dbd9b30603f289701723cdea52af3df4'
AND (
token = 'OAm6HeZKoA84fAOqbm+cw7ty+YhkJ8reMnFQiNv4W/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)