UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/VDYxXejxEPmo+pSa4qfOtVDPeGGAy96jo5d+R0k3SQ=' 
WHERE 
  key_id = 'f09357b7fe402a4c297722f3c6f01b8abfb4c9efa256f88cbd2b4cc90313e636' 
  AND (
    token = '/VDYxXejxEPmo+pSa4qfOtVDPeGGAy96jo5d+R0k3SQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034