UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Q9bIEWgtVmLJHnU1lGbButOMRb8M1QjfatA/sgeA+c='
WHERE
key_id = '20d47fb031d71cbc285bc120ac8ad993326bffb8aa1490b6605852d2a7dd47cd'
AND (
token = '9Q9bIEWgtVmLJHnU1lGbButOMRb8M1QjfatA/sgeA+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)