UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8gT73Y2XM0DcjacsOfwwRe2Pxpviq3uQmkyayXfDrTc='
WHERE
key_id = '9ed0d229cf7ce4ecae2405f26ebc0eb9044626216d91308029ee7cd19de3f394'
AND (
token = '8gT73Y2XM0DcjacsOfwwRe2Pxpviq3uQmkyayXfDrTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)