UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IBc+TEhgGBqmpELDcA/Ah9dkkVKsC04HPn1Zu0qRvi0='
WHERE
key_id = 'ff749afaff7a9203204aeb5f1c0f5ea2eda797dc2dfef1a016a4f65903a08340'
AND (
token = 'IBc+TEhgGBqmpELDcA/Ah9dkkVKsC04HPn1Zu0qRvi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)