UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FQBJ4RHXtDxwk36TZz9xvi3miiRVLQRXn8g9e3654Mg=' 
WHERE 
  key_id = '4b0ab28c0be28331e72801833330cf43a2bf007d703591f952a9f39feb907339' 
  AND (
    token = 'FQBJ4RHXtDxwk36TZz9xvi3miiRVLQRXn8g9e3654Mg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037