UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LlnKZ3qwZGGF1ooAPIHYlrbNRA2RLOmoVfqeXn6f8NE=' 
WHERE 
  key_id = '6d5a8cf569744499d8cf9d426c594f2e7549ccc9ff5a316487f5b2df6f8f0aed' 
  AND (
    token = 'LlnKZ3qwZGGF1ooAPIHYlrbNRA2RLOmoVfqeXn6f8NE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037