UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LmEGi7dBQZjMF1GLINXv4kDwwN9QUgTQe1mEkB1brDU=' 
WHERE 
  key_id = 'b5ee3a5fb3e6070eeaa762b60a66c9fb59d30aac4fe8bbe8725ad260f7ec0d26' 
  AND (
    token = 'LmEGi7dBQZjMF1GLINXv4kDwwN9QUgTQe1mEkB1brDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030