UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qszkKzw7mBIr81/M6TrzVAd36bCL72ilz9qP6ONl9Qs='
WHERE
key_id = '721f89bcad9fe4355163ae65797272028b8e8a68e267c4ff74e39ff2597bc1cf'
AND (
token = 'qszkKzw7mBIr81/M6TrzVAd36bCL72ilz9qP6ONl9Qs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)