UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y2/oAXsdf1LROMe7lq1ODNajaaGT7R6KOgjFkpZ5lTQ='
WHERE
key_id = 'bc574bb6318761edcbae27836095a42d97f69f0739b4c36c69e05a327ea5dd68'
AND (
token = 'y2/oAXsdf1LROMe7lq1ODNajaaGT7R6KOgjFkpZ5lTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)