UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fA/8GoTyHgWwnRKyULIc/JxnFSclzQdrp4bNB+dy1GM=' 
WHERE 
  key_id = '62321315483dcf96385f08121e6e0d69d01edb0cfbe2b7b789734fe065ad4bc7' 
  AND (
    token = 'fA/8GoTyHgWwnRKyULIc/JxnFSclzQdrp4bNB+dy1GM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039