UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '14gI/RJS8K+8n9ELYWq3mVR+OWcSv79ZDlUEKi0cuHs='
WHERE
key_id = 'f163b95bd7b547fc26842d71e165fc12d44033e1b7ff1b80314d3162fabff97f'
AND (
token = '14gI/RJS8K+8n9ELYWq3mVR+OWcSv79ZDlUEKi0cuHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)