UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MylmCCVByxHXD4dGkIH2pPiN6bLLFofR5D7n19luwHQ='
WHERE
key_id = 'c8da1e6bb6d82f98d99c4ff7b18fe10530b5e5783b76f99c12d0a7ed7468c6c1'
AND (
token = 'MylmCCVByxHXD4dGkIH2pPiN6bLLFofR5D7n19luwHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)