UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GrVIlpFFxTGzrzjknSiiq/QLBCNtOVHQugrv1iCBoaw='
WHERE
key_id = 'd8b8421f9ae4c73b0cf8b998d960ed19106a4f7ed4c059ea97b53588bdfdc32d'
AND (
token = 'GrVIlpFFxTGzrzjknSiiq/QLBCNtOVHQugrv1iCBoaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)