UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rc5wq7i0C+NIL8kVHaMPRDKnrcJpgbsjI+0Tjs0tjI8=' 
WHERE 
  key_id = '8925a8facd6dc803adcd847fc722c922450d9128b56f8b1201891eb4370e4c29' 
  AND (
    token = 'Rc5wq7i0C+NIL8kVHaMPRDKnrcJpgbsjI+0Tjs0tjI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026