UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ke6aTUN1qyIIoNk7+zGMn30xrq3dFuYd1Vv9ve17DB4='
WHERE
key_id = '0450cadf613d30c22ab5956084e54909fc2ce6f932cd0bb92a2c8024d21c7137'
AND (
token = 'ke6aTUN1qyIIoNk7+zGMn30xrq3dFuYd1Vv9ve17DB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)