UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jpt7oY5K9UmfEqWbtUTubFNL5dJ3c/Wsw8yGwA+RyIM=' 
WHERE 
  key_id = '7e3f4d7c75ef1708818c523206bd9dda8dd47f1a1ad26800266466bce7955523' 
  AND (
    token = 'Jpt7oY5K9UmfEqWbtUTubFNL5dJ3c/Wsw8yGwA+RyIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034