UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VXHrnhiX/1LlLS0l3pE69lhjqMvlqsMma0kksg2gQFE='
WHERE
key_id = 'bcc96951a350a42388e0c80af91b3a66a24aeed58d3cf1f78b74b5c6a280655a'
AND (
token = 'VXHrnhiX/1LlLS0l3pE69lhjqMvlqsMma0kksg2gQFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)