UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e5FshsA3HdlmgtC17faWVQy9hYVWLI4SLalQNSzlEo4=' 
WHERE 
  key_id = '3336995502f1ef0e1f64ab6ccee9484aaea572c7d2ca26ed2293e6dfbcabd031' 
  AND (
    token = 'e5FshsA3HdlmgtC17faWVQy9hYVWLI4SLalQNSzlEo4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042