UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ruruLgIuV42C4ngrlSiGgsLdOCETeKUqVW0rqBiqbIg='
WHERE
key_id = '37ad070ac2675e97d1fc1e8f449bf51fa789ad67e9a517dae5942a8acdcd3f27'
AND (
token = 'ruruLgIuV42C4ngrlSiGgsLdOCETeKUqVW0rqBiqbIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)