UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9+6s1x5pTMoSAoGXOllhExl574DHaTTJUK7GRqHPgdw=' 
WHERE 
  key_id = '67a626778f050a526a7e36a33d567181c598bbb3435ba055e244e76c6796d5b9' 
  AND (
    token = '9+6s1x5pTMoSAoGXOllhExl574DHaTTJUK7GRqHPgdw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055