UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PXu0rJhCOUDHgJYqo0zCnQt8nEkStdqDxx6v/+Zf3vc='
WHERE
key_id = '321a08494b3eedd075ef06996352b65437fa503fef517fd4e1bc6c003f82562d'
AND (
token = 'PXu0rJhCOUDHgJYqo0zCnQt8nEkStdqDxx6v/+Zf3vc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)