UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ep97kkEdoLFfZVfin40EZygN9eNszP83S8LdYc/jyxA='
WHERE
key_id = 'c5fe9099277a74e60f0ccae18bf4692e381f81ac3dd5aae6e27cabdc0b458842'
AND (
token = 'Ep97kkEdoLFfZVfin40EZygN9eNszP83S8LdYc/jyxA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)