UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LPnC7i+N1S1kgwqbrlyRIlv4cpKmfGxjGbRtPXl25Tc='
WHERE
key_id = 'b562b377dc750bc1a49a844eea7e2c07c121982c8c126ffbf65476b553ba4804'
AND (
token = 'LPnC7i+N1S1kgwqbrlyRIlv4cpKmfGxjGbRtPXl25Tc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)