UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rGRE7lq3NqKfb4zJ7hehU+4aeRGuxlwEUYAOLdfQJIQ='
WHERE
key_id = '414990faf4e2c86d1cf42ab14b4eebceb8283431a41e13ff7e33829c18eec7be'
AND (
token = 'rGRE7lq3NqKfb4zJ7hehU+4aeRGuxlwEUYAOLdfQJIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)