UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T548ob1tEXdw/WwNtRAMWBa1RPBv+RkLOtdaGPIi4AU='
WHERE
key_id = 'e5284da039bebfab39324d4f7b4578cbd4a91ec2f9c9b59fdf97d31dbaec5136'
AND (
token = 'T548ob1tEXdw/WwNtRAMWBa1RPBv+RkLOtdaGPIi4AU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)