UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bUwSixFCBvoPqLH/hqT/X0kibXkNysUM2cdRyKvyY6c='
WHERE
key_id = 'ac71e4f8ffebcf439ba95b02a5c41b1b054deb03e9c62e020db100bcc20945fd'
AND (
token = 'bUwSixFCBvoPqLH/hqT/X0kibXkNysUM2cdRyKvyY6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)