UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6a6/djvT+l4rxstgYAa2D+zRUIzZZmw/9St5Ce0GnkQ=' 
WHERE 
  key_id = '87068b5e72b5a188acf8bda91622f69d550e3a7cbacedbc46a1278b0b21e8f1e' 
  AND (
    token = '6a6/djvT+l4rxstgYAa2D+zRUIzZZmw/9St5Ce0GnkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025