UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PECMLPs57F7dxz8hbZi9fusx85oSGwCiuibt7F7Ueyw='
WHERE
key_id = '2be385e1af0e428a39597e21b73e5c9298f1c6ce8e82d746b79b98e992a82e38'
AND (
token = 'PECMLPs57F7dxz8hbZi9fusx85oSGwCiuibt7F7Ueyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)