UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yhTAQ4FUqVQWSEdgQXaiPVqvNG9UehQnWCnpFakUsuk='
WHERE
key_id = '0f3e11bda37956776cb985b878194af807130f8c5bf962b3da10af38ee6ec4f7'
AND (
token = 'yhTAQ4FUqVQWSEdgQXaiPVqvNG9UehQnWCnpFakUsuk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)