UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jhKbXfMg4pTbACpbtx6cnmk+H0GRynDPMxVYQzR+CWU='
WHERE
key_id = 'c5eeeafc07b95588d8ef2321c90edc59a91ae83d751ea1c0f88ab4bf607bbe6d'
AND (
token = 'jhKbXfMg4pTbACpbtx6cnmk+H0GRynDPMxVYQzR+CWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)